Grokking System Design Fundamentals
Rate this course
Ask Author
Contribute
Back to course home

52% completed

Vote For New Content
System Design Fundamentals
Introduction to System Design
Load Balancing
Introduction to Load Balancing
Load Balancing Algorithms
Uses of Load Balancing
Load Balancer Types
Stateless vs. Stateful Load Balancing
High Availability and Fault Tolerance
Scalability and Performance
Challenges of Load Balancers
API Gateway
Introduction to API Gateway
Usage of API gateway
Advantages and disadvantages of using API gateway
Key Characteristics of Distributed Systems
Scalability
Availability
Latency and Performance
Concurrency and Coordination
Monitoring and Observability
Resilience and Error Handling
Fault Tolerance vs. High Availability
Network Essentials
HTTP vs. HTTPS
TCP vs. UDP
HTTP: 1.0 vs. 1.1 vs 2.0 vs. 3.0
URL vs. URI vs. URN
Domain Name System (DNS)
Introduction to DNS
DNS Resolution Process
DNS Load Balancing and High Availability
Caching
Introduction to Caching
Why is Caching Important?
Types of Caching
Cache Replacement Policies
Cache Invalidation
Cache Read Strategies
Cache Coherence and Consistency Models
Caching Challenges
Cache Performance Metrics
CDN
What is CDN?
Origin Server vs. Edge Server
CDN Architecture
Push CDN vs. Pull CDN
Data Partitioning
Introduction to Data Partitioning
Partitioning Methods
Data Sharding Techniques
Benefits of Data Partitioning
Common Problems Associated with Data Partitioning
Proxies
What is a Proxy Server?
Uses of Proxies
VPN vs. Proxy Server
Redundancy and Replication
What is Redundancy?
What is Replication?
Replication Methods
Data Backup vs. Disaster Recovery
CAP & PACELC Theorems
Introduction to CAP Theorem
Components of CAP Theorem
Trade-offs in CAP Theorem
Examples of CAP Theorem in Practice
Beyond CAP Theorem
System Design Trade-offs in Interviews
Introduction to Databases
SQL Databases
NoSQL Databases
SQL vs. NoSQL
ACID vs BASE Properties
Real-World Examples and Case Studies
SQL Normalization and Denormalization
In-Memory Database vs. On-Disk Database
Data Replication vs. Data Mirroring
Database Federation
What are Indexes?
Types of Indexes
Introduction to Bloom Filters
Benefits & Limitations of Bloom Filters
Variants and Extensions of Bloom Filters
Applications of Bloom Filters
Difference Between Long-Polling, WebSockets, and Server-Sent Events
What is Quorum?
What is Heartbeat?
What is Checksum?
Uses of Checksum
What is Leader and Follower Pattern?
What is Security and Privacy?
What is Authentication?
What is Authorization?
Authentication vs. Authorization
OAuth vs. JWT for Authentication
What is Encryption?
What are DDoS Attacks?
Introduction to Messaging System
Introduction to Kafka
Messaging patterns
Popular Messaging Queue Systems
RabbitMQ vs. Kafka vs. ActiveMQ
Scalability and Performance
What is a Distributed File System?
Architecture of a Distributed File System
Key Components of a DFS
Batch Processing vs. Stream Processing
XML vs. JSON
Synchronous vs. Asynchronous Communication
Push vs. Pull Notification Systems
Microservices vs. Serverless Architecture
Message Queues vs. Service Bus
Stateful vs. Stateless Architecture
Event-Driven vs. Polling Architecture
Quiz
Examples of CAP Theorem in Practice

Let’s look at how some real-world systems exemplify CAP trade-offs:

  • MongoDB (CP): MongoDB is a popular NoSQL database which, by default, prioritizes consistency. It uses a primary-secondary replication model. Only the primary can accept writes, and if the primary is lost (partitioned away or down), the system elects a new primary. During that failover window, writes are not accepted – a sacrifice of availability to ensure no two primaries exist (consistency). Once a new primary is in place and secondaries are synchronized, the cluster resumes normal operations. This makes MongoDB CP: it won’t give you an outdated answer (it would rather pause), which is good for applications where stale data could be harmful.

  • Cassandra (AP): Cassandra is a distributed database that takes the opposite approach. It has no single primary node – any node can accept writes at any time. This yields high availability and scalability. If a partition happens, Cassandra keeps all sides running; writes might conflict, but the system will reconcile them (using timestamps, hinted handoff, repair jobs, etc.) after the fact. Thus, Cassandra is willing to return older data rather than fail a request, embodying an AP system. It provides tunable consistency (you can configure how many replicas must ack a read/write), but the default philosophy is “always be available.” Many large-scale websites use Cassandra for features like user activity feeds, where it’s okay if one replica is briefly behind as long as the service is up.

  • ZooKeeper (CP): ZooKeeper is a coordination service often used for configuration management, leader election, and other tasks in distributed applications. It is famously a CP system. ZooKeeper uses an algorithm (Zab) that requires a majority quorum of nodes to operate. If a network split leaves the cluster without a quorum, the minority side will stop functioning (becoming unavailable) to preserve a single consistent state. In other words' ZooKeeper “sacrifices availability in order to achieve consistency and partition tolerance” – if it cannot guarantee the latest state, it simply won’t respond. This makes ZooKeeper ideal for things like distributed locks and config where consistency (everyone agreeing on one leader, for example) is crucial.

  • DynamoDB (AP): DynamoDB, a cloud key-value store from Amazon, is built on the principles of Amazon’s Dynamo paper. DynamoDB is designed to scale across multiple data centers and remain available. It replicates data across zones and continues serving even if some replicas or network links fail, favoring availability. By default, reads are eventually consistent (you might read slightly stale data if a partition occurred), though it offers an option for strongly consistent reads within a region. Amazon’s goal with DynamoDB is that operations (especially writes to things like a shopping cart or user preference) should succeed even in the face of outages – they’ll sort out any inconsistencies later.

These examples show that different systems make different trade-offs. There is no free lunch – you pick the two properties that matter most for your use case. Next, we’ll see an important extension to CAP that considers another dimension: latency.

Trade-offs in CAP Theorem
Beyond CAP Theorem
Mark as Completed